package com.ruoyi.system.utils;

import java.io.File;
import java.net.MalformedURLException;

public class FilePathToHttpUrl {
    public static void main(String[] args) {
        String absolutePath = "D:\\user\\问题.xls"; // 本地文件的绝对路径
        File file = new File(absolutePath);

        try {
            String httpUrl = "http://localhost/" + file.getName(); // 构建HTTP路径
            System.out.println("HTTP URL: " + httpUrl);
        } catch (Exception e) {
            System.out.println("Failed to convert file path to HTTP URL: " + e.getMessage());
        }
    }
}